<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>大翔五子棋</title>
    <link rel="shortcut icon" href="/static/images/favicon.ico" >
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/bootstrap-table.css">
    <script src="/static/js/jquery-1.12.4.min.js"></script>
    {#    <script src="/static/js/bootstrap.min.js"></script>#}
    <script src="/static/js/bootstrap.js"></script>
    <script src="/static/js/bootstrap-table.js"></script>
    <script src="/static/js/bootstrap-table-zh-CN.js"></script>
    <style>
        .row {
            margin: 100px
        }

    </style>
    <script >

        function fnOpenRoom() {
            var oSelect = $('.table').bootstrapTable('getSelections');
            if(oSelect.length == 1){
                window.location.href = "/openRoom/" + oSelect[0].id;
            }else {
                alert("请选中一行") ;
                return;
            }
        }

        function fnAddRoom() {
            var sName = "";
            sName = document.getElementById("name").value;
            var oRadio1 = document.getElementById("optionsRadios1")
            var oType = 1;
            if(oRadio1.checked){
                oType = 1;
            }else{
                oType = 2;
            }
            console.log(sName, oType);
            $.ajax({
                data: {
                    name: sName,
                    type: oType
                },
                dataType: "json",
                url: "/addRoom",
                type: "get",
                success: function (dat) {
                    window.location.href = "/openRoom/"+ dat["key"];
                }, error: function (o, e) {
                    alert(e);
                }
            })
        }
    </script>
</head>
<body>
<div class="row">
    <table data-toggle="table" data-url="/ranking/ranking" data-show-refresh="true" data-show-toggle="true"
           data-show-columns="true"
           data-search="true" data-select-item-name="toolbar1" data-pagination="true" data-sort-name="id"
           data-sort-order="asc">
        <thead>
        <tr>
            <th data-field="state" data-radio="true">Item ID</th>
            <th data-field="id" data-sortable="true">排名</th>
            <th data-field="name" data-sortable="true">用户名</th>
            <th data-field="source" data-sortable="true">获得分数</th>
            <th data-field="vip" data-sortable="true">内测用户</th>
        </tr>
        </thead>
    </table>

    <!--/.row-->
    <!-- 模态框（Modal） -->

</div>


</body>

</html>